package exception;


import entity.ClientResponse;

/**
 * 参数校验失败异常
 *
 * @author shishaolong
 * @datatime 2020/7/3 14:09
 */
public class ParamCheckFailureException extends Exception implements IClientResponse {

    /**
     * 响应信息
     */
    private ClientResponse clientResponse;

    public ParamCheckFailureException(String errMessage) {
        super(errMessage);
        this.clientResponse = ClientResponse.createError(errMessage);
    }

    public ParamCheckFailureException(ClientResponse clientResponse) {
        super(clientResponse.getMessage());
        this.clientResponse = clientResponse;
    }

    @Override
    public ClientResponse getClientResponse() {
        return clientResponse;
    }
}
